#coding=utf-8
import datetime
def str2date(s):
    return datetime.date( *map(int, s.split('-')) )
    
def order_list(first, list_):
    r = list_[:]
    if first in r:
        r.remove(first)
    r.insert(0, first)
    return r
def none2blank(s):
    print  s
    if not s:return ''
def preview_html(h, d1, d2, u1, u2):
     
    html = '''
        <table border="0" cellpadding="2" cellspacing="0" width="97%%">
        <tr valign="bottom"><td valign="middle" style="width:1%%;">
        <table width="150" cellspacing="0" border="0">
        <tr><td bgcolor="#b4d0dc" style="border: none; white-space: nowrap" valign="middle" nowrap><table width="100%%" cellspacing="0" cellpadding="3" border="0"><tr><td align="left" bgcolor="#ffffff" style="border: none; white-space: nowrap" nowrap><a href=%s target="_blank"><font size="+0">%s</font></a> 
        <br> 
        %s
        <br> 
        %s
        <br> 
        <font color="green" title=%s>%s</font> 
        <br> 
        </td></tr></table>
        '''%(u2, h, d1, d2, u1,u1)

    return html
    
